package com.google.gwt.sample.dynatablerf.server;

import com.google.gwt.sample.dynatablerf.server.business.ControladorFactory;
import com.google.gwt.sample.dynatablerf.server.domain.Servico;
import com.google.web.bindery.requestfactory.shared.Locator;

public class ServicoLocator extends Locator<Servico, Long> {

	@Override
	public Servico create(Class<? extends Servico> clazz) {
		return new Servico();
	}

	@Override
	public Servico find(Class<? extends Servico> clazz, Long id) {
		return ControladorFactory.getControladorServico().findById(id);
	}

	@Override
	public Class<Servico> getDomainType() {
		return Servico.class;
	}

	@Override
	public Long getId(Servico domainObject) {
		return domainObject.getId();
	}

	@Override
	public Class<Long> getIdType() {
		return Long.class;
	}

	@Override
	public Object getVersion(Servico domainObject) {
		return domainObject.getVersion();
	}

}
